package dialogs;

import javax.swing.table.AbstractTableModel;
import java.util.*;

public class KeyValueTableModel extends AbstractTableModel {
	public String[] columnNames = { "Properties", "Values" };
	public ArrayList data = null;

	public KeyValueTableModel() {
		data = new ArrayList();
	}

	public String getColumnName(int column) {
		return this.columnNames[column];
	}

	public int getColumnCount() {
		return 2;
	}

	public int getRowCount() {
		return data.size();
	}

	public Object getValueAt(int row, int column) {
		Info info = (Info) this.data.get(row);
		if (0 == column)
			return info.property;
		else
			return info.value;
	}
}
